package com.teaching.teachingsupport.controller.studentcontroller;

import com.teaching.teachingsupport.common.pojo.dataobject.Notification;
import com.teaching.teachingsupport.common.pojo.dataobject.Todo;
import com.teaching.teachingsupport.common.utils.SecurityUtils;
import com.teaching.teachingsupport.service.service2.studentservice.NotificationService;
import com.teaching.teachingsupport.service.service2.studentservice.TodoService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/student")
@RequiredArgsConstructor
public class StudentHomepageController {

    private final TodoService todoService;
    private final NotificationService notificationService;
    private final SecurityUtils securityUtils;

    @GetMapping("/notifications")
    public List<Notification> getNotifications() {
        return notificationService.getNotificationsByUserId(securityUtils.getCurrentUserId());
    }

    @GetMapping("/todo")
    public List<Todo> getTodo() {
        return todoService.getTodoByUserId(securityUtils.getCurrentUserId());
    }
}
